package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.notice;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: NoticeService
 * @Date: Created in 14:03 2022/7/12
 * @Description: 通知模块服务
 */
@Service
@Slf4j
public class NoticeService extends BaseService {

    /**
     * 通知组分页列表
     * @param
     * @return
     */
    public RespEntity noticeGroupListPage(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeGroupListPage","notice");
    }
    /**
     * 通知组新增、编辑
     * @param
     * @return
     */
    public RespEntity noticeGroupAddOrUpdate(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeGroupAddOrUpdate","notice");
    }
    /**
     * 通知组删除
     * @param
     * @return
     */
    public RespEntity noticeGroupDel(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeGroupDel","notice");
    }
    /**
     * 联系人分页列表
     * @param
     * @return
     */
    public RespEntity noticeContactsListPage(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeContactsListPage","notice");
    }
    /**
     * 联系人新增、编辑
     * @param
     * @return
     */
    public RespEntity noticeContactsAddOrUpdate(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeContactsAddOrUpdate","notice");
    }
    /**
     * 联系人删除
     * @param
     * @return
     */
    public RespEntity noticeContactsDel(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeContactsDel","notice");
    }
    /**
     * 组内联系人分页列表
     * @param
     * @return
     */
    public RespEntity noticeGroupContactsListPage(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeGroupContactsListPage","notice");
    }
    /**
     * 联系人绑定分组
     * @param
     * @return
     */
    public RespEntity noticeGroupContactsAdd(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeGroupContactsAdd","notice");
    }
    /**
     * 组内删除联系人
     * @param
     * @return
     */
    public RespEntity noticeGroupContactsDel(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeGroupContactsDel","notice");
    }
    /**
     * 短信语音通知
     * @param
     * @return
     */
    public RespEntity sMSVoiceNotice(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"sMSVoiceNotice","notice");
    }
    /**
     * 消息回复
     * @param
     * @return
     */
    public RespEntity messageReply() {
        JSONObject jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        System.out.println("messageReply:"+jsonParam.toString());
        return communicationJava(jsonParam,"noticeUpdateState","notice");
    }
    /**
     * 记录分页列表
     * @param
     * @return
     */
    public RespEntity noticeRecordListPage(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"noticeRecordListPage","notice");
    }

    /**
     * 更新短信、语音状态（云智信）
     * @param
     * @return
     */
    public RespEntity updateStateYZX(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"updateStateYZX","notice");
    }

    /**
     * 短信语音余量新增、编辑
     * @param
     * @return
     */
    public RespEntity addOrUpdate(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"addOrUpdate","smsVoiceMargin");
    }

    /**
     * 短信、语音余量列表
     * @param
     * @return
     */
    public RespEntity smsVoiceMarginList(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"smsVoiceMarginList","smsVoiceMargin");
    }

    /**
     * 批量插入单位短信、语音使用条数
     * @param
     * @return
     */
    public RespEntity setBusinessCount(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"setBusinessCount","smsVoiceMargin");
    }

    /**
     * 注册短信验证码
     * @param
     * @return
     */
    public RespEntity register(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return communicationJava(jsonParam,"register","notice");
    }

}
